package com.beimin.evedata.model.inv;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@org.hibernate.annotations.Entity(mutable = false)
@Table(name = "invcontroltowerresources")
@IdClass(InvControlTowerResourceId.class)
public class InvControlTowerResource {
	@Id
	private int controlTowerTypeID;
	@Id
	private int resourceTypeID;
	@ManyToOne
	@JoinColumn(name = "purpose")
	private InvControlTowerResourcePurpose purpose;
	private int quantity;
	private Integer minSecurityLevel;
	private Integer factionID;

	public int getControlTowerTypeID() {
		return controlTowerTypeID;
	}

	public void setControlTowerTypeID(int controlTowerTypeID) {
		this.controlTowerTypeID = controlTowerTypeID;
	}

	public int getResourceTypeID() {
		return resourceTypeID;
	}

	public void setResourceTypeID(int resourceTypeID) {
		this.resourceTypeID = resourceTypeID;
	}

	public InvControlTowerResourcePurpose getPurpose() {
		return purpose;
	}

	public void setPurpose(InvControlTowerResourcePurpose purpose) {
		this.purpose = purpose;
	}

	public int getQuantity() {
		return quantity;
	}

	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}

	public Integer getMinSecurityLevel() {
		return minSecurityLevel;
	}

	public void setMinSecurityLevel(Integer minSecurityLevel) {
		this.minSecurityLevel = minSecurityLevel;
	}

	public Integer getFactionID() {
		if (factionID != null)
			return factionID;
		return -1;
	}

	public void setFactionID(Integer factionID) {
		this.factionID = factionID;
	}

	public boolean hasFaction() {
		return factionID != null;
	}
}
